﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<PhotoGallery.Core.Business.AccountIndexModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    人员管理 - 重庆市公安图片管理系统
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="con-box">
        <div class="head">
            <h2>
                人员管理</h2>
        </div>
        <div class="con">
            <div class="box">
                <a href='<%= Url.Action("Add") %>' class="sexybutton"><span><span><em class='add'>新增人员</em></span></span></a>
            </div>
            <div class="box">
                <form id="formSearch">
                <label for="name">
                    姓名：</label>
                <input type="text" id="name" name="name" class="text w50" value='<%= Html.Encode(ViewData["Name"]) %>' />
                <label>
                    性别：</label>
                <select id="Gender" name="Gender" class="text">
                    <option value="2">-性别-</option>
                    <option value="0">女</option>
                    <option value="1">男</option>
                </select>
                <label>
                    班组：</label>
                <%--<% Html.RenderPartial("DetectionCompanyGroup"); %>--%>
                <a href="javascript:;" id="btn-search" class="sexybutton"><span><span><em class="search">
                    筛选</em></span></span></a> <a href='<%= Url.Action("Index") %>' class="sexybutton"><span>
                        <span><em class="">查看全部</em></span></span></a>
                </form>
            </div>
            <table class="info-table" cellpadding="0" cellspacing="0" border="0">
                <thead>
                    <tr>
                        <th class="w50">
                            序号
                        </th>
                        <th>
                            姓名
                        </th>
                        <th>
                            登录名
                        </th>
                        <th>
                            性别
                        </th>
                        <th>
                            联系方式
                        </th>
                        <th>
                            生日
                        </th>
                        <th>
                            住址
                        </th>
                        <th class="w80">
                            操作
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <% int i = 0;
                       foreach (var item in Model.Accounts)
                       { %>
                    <tr>
                        <td class="center">
                            <%= i++ %>
                        </td>
                        <td>
                            <%= Html.Encode(item.Name) %>
                        </td>
                        <td>
                            <%= Html.Encode(item.LoginName) %>
                        </td>
                        <td>
                            <%= item.Gender == 0.0m ? "女" : "男" %>
                        </td>
                        <td>
                            <%= Html.Encode(item.Telephone) %>
                        </td>
                        <td>
                            <%= Html.Encode(String.Format("{0:yyyy-MM-dd}", item.Birthday)) %>
                        </td>
                        <td>
                            <%= Html.Encode(item.Address) %>
                        </td>
                        <td>
                            <%= Html.ActionLink("编辑", "Edit", new { id = item.Id }, new { @class="edit"})%>
                            |
                            <%= Html.ActionLink("删除", "Delete", new { id = item.Id }, new { @class="delete"})%>
                        </td>
                    </tr>
                    <% } %>
                </tbody>
            </table>
            <div id="pager">
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ScriptContent" runat="server">
    <script type="text/javascript">
        $(function () {
            $("#btn-search").click(function () {
                var url = '<%= Url.Action("Index") %>';
                window.location = url + '?' + $("#formSearch").serialize();
            });
            $("#Gender").val($.query.get('Gender'));

        });
    </script>
</asp:Content>
